var e = require;
var t = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var n = e("BaseModuleUI"),
    a = e("NotifyEventType"),
    i = e("AssetsManager"),
    r = cc._decorator,
    s = r.ccclass,
    l = r.property,
    c = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (
                (t.equip_icon_sprite = null),
                (t.equip_name_label = null),
                (t.equip_coin_label = null),
                (t.choose_node = null),
                (t.equip_info = null),
                t
            );
        }
        return (
            __extends(t, e),
            (t.prototype.showEquipInfo = function (e) {
                (this.equip_info = e),
                    (this.equip_name_label.string = "" + e.eq_name),
                    (this.equip_coin_label.string = "" + e.eq_sale),
                    (this.equip_icon_sprite.spriteFrame = i.default
                        .getInstance()
                        .getEquipIconFrame("equip_" + e.eq_ID)),
                    (this.choose_node.active = !1),
                    this.node.on("click", this.showChooseEquip, this);
            }),
            (t.prototype.addEvent = function () {
                this.attachEvent(a.default.SEND_CHOOSE_EQUIP_INFO, this.showChooseEquipInfo, this);
            }),
            (t.prototype.showChooseEquip = function () {
                this.emitEvent(a.default.SEND_CHOOSE_EQUIP_INFO, {use: !1, info: this.equip_info});
            }),
            (t.prototype.showChooseEquipInfo = function (e, t) {
                var o = t.info;
                this.choose_node.active = this.equip_info.eq_ID == o.eq_ID && !t.use;
            }),
            (t.prototype.onDisable = function () {}),
            (t.prototype.onDestroy = function () {
                this.detachEvents();
            }),
            __decorate([l(cc.Sprite)], t.prototype, "equip_icon_sprite", void 0),
            __decorate([l(cc.Label)], t.prototype, "equip_name_label", void 0),
            __decorate([l(cc.Label)], t.prototype, "equip_coin_label", void 0),
            __decorate([l(cc.Node)], t.prototype, "choose_node", void 0),
            __decorate([s], t)
        );
    })(n.default);
o.default = c;
